package com.itheima.demo;
import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        JD[] jds=new JD[2];
        jds[0]=new Light("灯",false);
        jds[1]=new Fridge("冰箱",false);
        Manager manager=Manager.getInstance();
        boolean flag=true;
        while(flag){
            manager.show(jds);
            Scanner sc=new Scanner(System.in);
            System.out.println("欢迎来到智能家居系统");
            System.out.println("请输入您想控制的设备编号");
            int choice=sc.nextInt();
            switch (choice){
                case 1:
                    Manager.control(jds[0]);
                    break;
                case 2:
                    Manager.control(jds[1]);
                    break;
                case 0:
                    System.out.println("退出");
                    flag=false;
                    break;
            }
        }

    }
}
